package com.guli.eduService.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.guli.eduService.entity.EduComment;
import com.guli.eduService.mapper.EduCommentMapper;
import com.guli.eduService.service.EduCommentService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 评论 服务实现类
 * </p>
 *
 * @author zxc
 * @since 2023-04-25
 */
@Service
public class EduCommentServiceImpl extends ServiceImpl<EduCommentMapper, EduComment> implements EduCommentService {

    @Override
    public void getCommentByCourseId(Page<EduComment> page, String courseId) {
        // 1.封装查询条件（课程id == 当前所查看的课程id）
        QueryWrapper<EduComment> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("course_id" , courseId);
        // 2.分页查询数据;
        this.page(page , queryWrapper);
    }
}
